package dao;

import java.util.List;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import model.User;

public interface UserMapper {
	
	@Select("select * from user")
	@Results({//实体字段和实际列名
		@Result(column="user_name",property="username")
		})
	List<User> getAllUser();
	
	
	@Select("select * from user where id = #{id}")//参数注入方式
	@Results({
		@Result(column="user_name",property="username")
		})
	User getOneUser(int id);
}
